#include "stdbool.h"

typedef struct ringbuf_t {
    char *buf;
	char *rptr;
	char *wptr;
	int size;
	int rnum;
	int wnum;
} ringbuf_t;

ringbuf_t *ringbuf_create(int size);
void ringbuf_destroy(ringbuf_t *r);
bool ringbuf_empty(ringbuf_t *r);
bool ringbuf_full(ringbuf_t *r);
int ringbuf_size(ringbuf_t *r);
int ringbuf_used(ringbuf_t *r);
int ringbuf_unused(ringbuf_t *r);
bool ringbuf_push(ringbuf_t *r, char *data, int len);
char *ringbuf_pop(ringbuf_t *r, char *buf, int buf_len);

